<template>
  <div>
    <van-sticky>
      <van-dropdown-menu active-color="#1989fa" v-if="projectId !== '-1'">
        <van-dropdown-item v-model="value" :options="option" />
      </van-dropdown-menu>
    </van-sticky>
    <div v-if="projectId === '-1'">
      <projectAddOrUpdate ref="projectAddOrUpdate"></projectAddOrUpdate>
    </div>
    <div v-else>
      <projectAddOrUpdate ref="projectAddOrUpdate" v-if="value === 0"></projectAddOrUpdate>
      <orderContract ref="orderContract" v-if="value === 1"></orderContract>
      <acceptanceSheet ref="acceptanceSheet" v-if="value === 2"></acceptanceSheet>
    </div>
  </div>
</template>

<script>
import projectAddOrUpdate from './projectAddOrUpdate.vue'
import orderContract from './orderContract.vue'
import acceptanceSheet from './acceptanceSheet.vue'

export default {
  name: "OrderAdd",
  components: {projectAddOrUpdate, orderContract, acceptanceSheet},
  data() {
    return {
      value: 0,
      option: [
        { text: "项目信息", value: 0 },
        { text: "项目合同", value: 1 },
        { text: "项目验收", value: 2 },
      ],
      projectId: "",
    };
  },
  created() {
    this.projectId = this.$route.params.projectId;
  },
  methods: {},
};
</script>

<style scoped>
::v-deep .van-dropdown-menu__bar {
  margin-bottom: 5px;
  box-shadow: none;
}
</style>